Set desktop = CreateObject("SilkTestLib.Desktop")
'desktop.Connect "localhost", 11199

Function InternetExplorer()
    'desktop.Attach "*\iexplore.exe", "", "xBrowser"
    Set InternetExplorer = desktop.ExecuteBrowserBaseState("C:\Program Files\Internet Explorer\iexplore.exe", _
                                                         "www.google.com", _
                                                         "/BrowserApplication[@browsertype='Internet Explorer']/BrowserWindow", _
                                                         "xBrowser")
End Function

Function Firefox()
    'desktop.Attach "*\firefox.exe", "", "xBrowser"
    Set Firefox = desktop.ExecuteBrowserBaseState("C:\Program Files\Mozilla Firefox\firefox.exe", _
                                                "www.google.com", _
                                                "/BrowserApplication[@browsertype='Firefox']/BrowserWindow", _
                                                "xBrowser")
End Function

Sub SimpleTestcase(browser)
    Set sf1 = desktop.Find(".//DomElement[@name='q']")
    Set searchField = browser.Find("//input[@name='q']")
    searchField.SetText "hello vbs"
    Set searchButton = browser.Find("//input[@name='btnG']")
    searchButton.DomClick()
End Sub

Sub SimpleTestcase2(browser)
    Set searchField = browser.Find("//input[@name='q']")
    searchField.hugo = "asd"
    WScript.Echo(searchField.hugo)
End Sub

Set browser = InternetExplorer()
'Set browser = Firefox()
SimpleTestcase2 browser


